.-
help for ^wls2stata^
.-
{smcl}

{pstd}Utility to convert negative missing data codes to Stata 
system-missing values.  It also allows for changing 
variable names, variable labels and value labels between
upper, lower and proper case.


{marker syntax}{...}
{title:Syntax}
{p 8 18 2}

{cmd:wls2stata} {varlist} [{cmd:,}{it:options}]

{synoptset 35 tabbed}{...}
{synopthdr}
{synoptline}
{synopt:{opt varn:ame}({cmd:upper} | {cmd:lower} | {cmd:proper})} change case of variable name{p_end}
{synopt:{opt varl:abel}({cmd:upper} | {cmd:lower} | {cmd:proper})} change case of variable label{p_end}
{synopt:{opt valu:elabel}({cmd:upper} | {cmd:lower} | {cmd:proper})} change case of value labels{p_end}
{synopt:{opt nor:ecode}({varlist})} list of variables not to be recoded{p_end}
{synopt:{opt skipstring}} do not recode string variables{p_end} 
{synoptline}   
    
{marker description}{...}
{title:Description}

{pstd}The Wisconsin Longitudinal Study uses negative integers in the range
-1 to -31 to describe missing values in numeric variables and string
representations of these numbers (e.g. "-1") to describe missing values
in text variables.  wls2stata will convert these negative codes to Stata 
missing values in the case of numeric variables and an empty string ("")
for text variables.  Using _all as the variable list will perform
this operation for all variables in the dataset, 

{pstd}Since the number of negative codes used in the WLS exceeds the number of 
missing codes available in Stata, bracketing summary variables, which use
{bf:codes -6 though -10}, are {bf:NOT recoded} to a Stata missing code.

{pstd}As of the {bf:WLS data release 13.01} all variables that are known to contain 
negative data other than missing codes were reviewed.  Variables with valid data within 
the negative code range are processed so that no valid responses are overwritten with a 
missing code.  Users can also add their own list of variables that should not be recoded 
through the {opt norecode} option.


{pstd}The negative codes are assigned missing value codes as follows:

	-1   ->  .d  (Don't know) 
	-2   ->  .i  (Inappropriate)  
	-3   ->  .r  (Refused)  
	-4   ->  .n  (Not ascertained)  
	-5   ->  .p  (Partial interview)  
	-27  ->  .s  (Not asked of Proxy)  
	-28  ->  .t  (Not asked via telephone)  
	-29  ->  .b  (Left Blank on SAQ)  
	-30  ->  .m  (Not part of MOSAQ)  

	-11  ->  .a  (At most part time worker)  
	-12  ->  .c  (At least full time worker)  
	-13  ->  .e  (Amount Differs For Generic/Brand-Name)  
	-14  ->  .f  (Amount Changes Over The Year (Vol))  
	-15  ->  .g  (Multiple Sessions)  
	-16  ->  .h  (Never went to usual provider)  
	-17  ->  .j  (Special Missing Code for Allocation Cases)  
	-18  ->  .k  (Unable to Code (ICD-9 related questions))  
	-19  ->  .l  (Occupational scores not assigned to military occupations)  
	-20  ->  .o  (Amt varies)  
	-21  ->  .q  (Pays all costs not covered by the plan)  
	-22  ->  .u  (Different payment arrangement)  
	-23  ->  .v  (Attended a HS in Wisconsin, did not graduate from that HS)  
	-24  ->  .w  (Volunteered, < 1 drink per day)  
	-25  ->  .x  (Only drank at religious services)  
	-26  ->  .y  (Unable to code, multiple people mentioned)  
	-31  ->  .z  (Not yet used)  

{pstd}In addition to recoding the values, wls2stata copies over value labels 
so that the system missing values have labels formerly corresponding 
to the negative codes.  


{marker options}{...}
{title:Options}

{phang}
{opt varname} allows to change the {bf:variable names} between lower, upper and 
proper case

{phang}
{opt varlabel}, allows to change the {bf:variable labels} between lower, upper and 
proper case

{phang}
{opt valuelabel} allows to change the {bf:value labels} between lower, upper and 
proper case

{phang}
{opt norecode} specifies a list of variables that will not have missing values 
recoded or value labels changed.  Names and labels of these variables will still
be changed if {opt varname} or {opt varlabel} is used.

{phang}
{opt skipstring} specifies that non-numeric variables present in {it:varlist} 
should not be recoded.  Recall that missing codes in string variables are changed
to an empty string, so recoding these variables involves loss of information.


{marker examples}{...}
{title:Examples}

{phang}{cmd:. set maxvar 30000}{p_end}
{phang}{cmd:. use wls_pub_13_01.dta}{p_end}
{phang}{cmd:. wls2stata _all}{p_end}
{phang}{cmd:. wls2stata h*,varlabel(proper) valuelabel(upper)}{p_end}
{phang}{cmd:. wls2stata _all,skipstring}{p_end}
{phang}{cmd:. wls2stata _all,norecode(x*)}{p_end}

